home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 49 / Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso / -serious- / misc / gedeiffel / install < prev    next >
Text File  |  1999-11-29  |  6KB  |  217 lines

  1. ; $VER: Installer 1.0 (24.1.99)
  2. ;
  3. ; An Amiga Installer for the SmallEiffel mode for GoldEd
  4. ;
  5. ; Copyright © 1999 Thomas Aglassinger. All rights reserved.
  6.  
  7. ;----------------------------------------------------------------------------
  8. ; Specify minimum installer version
  9. ;----------------------------------------------------------------------------
  10. (debug "set version")
  11. (set #minimum-installer-version 43)
  12. (set #minimum-installer-revision 3)
  13. (set #minimum-installer-id
  14.    (+ #minimum-installer-revision
  15.        (* #minimum-installer-version 65536)
  16.    )
  17. )
  18. (debug "  minimum-installer-id = " #minimum-installer-id)
  19. (debug "  current-installer-id = " @installer-version)
  20.  
  21. ;----------------------------------------------------------------------------
  22. ; Setup messages, prompts and help text
  23. ;----------------------------------------------------------------------------
  24.  
  25. (set #message-wrong-installer
  26. (cat "You have an old version of the program 'Installer' on your Amiga!\n\n"
  27.      "The installation procedure needs at least Installer "
  28.      #minimum-installer-version "." #minimum-installer-revision ".\n\n"
  29.      "Please obtain a newer version!\n\n"
  30.      "(Check Aminet or "
  31.      "the WWW site of the current owner of the rights for Amiga.)"
  32. ))
  33.  
  34. (set #message-welcome
  35. (cat "Welcome to the Amiga Installer for GedEiffel\n\n"
  36.      "This will install a SmallEiffel mode for GoldEd. It features a "
  37.      "syntax parser, a routine scanner and  a toolbar for some common "
  38.      "functions."
  39. ))
  40.  
  41. (set #update-registry-manually
  42. (cat "There has been a minor problem:\n\n"
  43.      "Because the registry editor has not been installed, the Eiffel "
  44.      "filetype could not have been created automatically. Thus, you "
  45.      "have to do it manually. However, this is no difficult:\n\n"
  46.      "Simply create a new filetype for \"*.e\" and assign all the "
  47.      "eiffel.* presets to it.\n\n"
  48.      "Refer to the GoldEd manual for details on how to perform these steps."
  49. ))
  50.  
  51. (set #message-exit
  52. (cat "\nThe SmallEiffel mode has been installed.\n\n"
  53.      "Please restart GoldEd."
  54. ))
  55.  
  56. (set #message-wrong-golded
  57. (cat "This script requires GoldED 4.7.\n\n"
  58.      "If you are using GoldEd 5 or later, download "
  59.      "aminet:text/edit/envSOF*.lha"
  60. ))
  61.  
  62.  
  63. ;----------------------------------------------------------------------------
  64. ; Check requirements
  65. ;----------------------------------------------------------------------------
  66.  
  67. ; Check installer version to piss people off and make them
  68. ; download a new one or forget about the whole thing - He he he.
  69. ; (The script should work with older versions, but how am I
  70. ; supposed to test this?)
  71. ;
  72. ; After that, check for GoldEd 4.7 to piss off users of GoldEd 5.
  73.  
  74. (procedure P-check-requirements
  75. (
  76.    (debug "check installer version")
  77.    (if (< @installer-version #minimum-installer-id)
  78.      (
  79.        (debug "installer too old")
  80.        (abort #message-wrong-installer)
  81.      )
  82.    )
  83.  
  84.    (debug "check golded version")
  85.    (set #golded-installed 0)
  86.    (if (exists "GOLDED:" (NOREQ))
  87.       (
  88.          (set #golded-version (getversion "golded:golded"))
  89.  
  90.          (set #version-high (/ #golded-version 65536))
  91.          (set #version-low (- #golded-version (* #version-high 65536)))
  92.  
  93.          (set #version-by-ten (+ (* 10 #version-high) #version-low))
  94.  
  95.          (if (= #version-by-ten 47) (set #golded-installed 1))
  96.       )
  97.    )
  98.  
  99.    (if (= 0 #golded-installed) (abort #message-wrong-golded))
  100. ))
  101.  
  102.  
  103. ;----------------------------------------------------------------------------
  104. ; Welcome user
  105. ;----------------------------------------------------------------------------
  106. (procedure P-welcome
  107. (
  108.    (debug "welcome")
  109.    (welcome #message-welcome)
  110. ))
  111.  
  112. ;----------------------------------------------------------------------------
  113. ; Copy files
  114. ;----------------------------------------------------------------------------
  115. (procedure P-copy-files
  116. (
  117.    (debug "copy-files")
  118.    (copylib
  119.       (prompt "Copy syntax parser")
  120.       (source "syntax/eiffel.parser")
  121.       (dest "golded:syntax")
  122.       (confirm)
  123.       (help @copylib-help)
  124.    )
  125.  
  126.    (complete 20)
  127.    (copylib
  128.       (prompt "Copy routine scanner")
  129.       (source "scanner/eiffel")
  130.       (dest "golded:parser")
  131.       (confirm)
  132.       (help @copylib-help)
  133.    )
  134.  
  135.    (complete 30)
  136.    (makedir "golded:tools/eiffel/arexx")
  137.    (foreach "tools/eiffel/arexx" "#?"
  138.       (copylib
  139.          (prompt "Copy ARexx scripts")
  140.          (source (tackon "tools/eiffel/arexx" @each-name))
  141.          (dest "golded:tools/eiffel/arexx")
  142.          (confirm)
  143.          (help @copylib-help)
  144.       )
  145.    )
  146.  
  147.    (complete 40)
  148.    (copyfiles
  149.       (prompt "Copy manual")
  150.       (source "Manual.guide")
  151.       (dest "golded:tools/eiffel")
  152.       (confirm)
  153.       (help @copyfiles-help)
  154.    )
  155.  
  156.    (complete 50)
  157.    (copyfiles
  158.       (prompt "Copy toolbar icons")
  159.       (source "toolbar/eiffel")
  160.       (dest "golded:toolbar/eiffel")
  161.       (confirm)
  162.       (all)
  163.       (help @copyfiles-help)
  164.    )
  165. ))
  166.  
  167. ;----------------------------------------------------------------------------
  168. ; Copy presets
  169. ;----------------------------------------------------------------------------
  170. (procedure P-copy-presets
  171. (
  172.    (debug "copy-presets")
  173.    (if (exists("golded:tools/regedit/regedit"))
  174.       (
  175.          (working "Updating registry...")
  176.          (run "golded:tools/regedit/regedit script=install.bat")
  177.       )
  178.       (
  179.          (copyfiles
  180.             (prompt "Copy eiffel.* presets")
  181.             (source "presets")
  182.             (dest "golded:presets")
  183.             (confirm)
  184.             (all)
  185.             (help @copyfiles-help)
  186.          )
  187.          (message #update-registry-manually)
  188.       )
  189.    )
  190. ))
  191.  
  192. ;----------------------------------------------------------------------------
  193. ; Exit
  194. ;----------------------------------------------------------------------------
  195. (procedure P-exit
  196. (
  197.    (debug "exit")
  198.  
  199.    (message (#message-exit) (all))
  200.    (exit (quiet))
  201. ))
  202.  
  203. ;----------------------------------------------------------------------------
  204. ; Do it!
  205. ;----------------------------------------------------------------------------
  206.  
  207. (complete   0) (P-check-requirements)
  208.  
  209. (complete   0) (P-welcome)
  210.  
  211. (complete  10) (P-copy-files)
  212.  
  213. (complete  60) (P-copy-presets)
  214.  
  215. (complete 100) (P-exit)
  216.  
  217.